#
# This is the TNOS configuration as distributed by KO4KS
#
comment "TNOS configuration for release $RELEASE"
commentlocal ""
commentlocal "Welcome to the autoexec.nos configuration program!"
commentlocal "There are a LOT of questions, but it ends eventually ;-)"
commentlocal ""
#
#
setlabel "Turn on the status line" "statline on" quiet
comment "Identify the station...."
label "Hostname for this TNOS machine" hostname
set HOSTNAME "$ans"
label "Callsign to use for this machine" "ax25 mycall"
set MYCALL "$ans"
label "IP address for this machine" "ip address"
set IPADDR "$ans"
setlabel "" "# Default Command Session prompting style" ""
setlabel "" prompt hostname
#
#
comment "Set up DNS for usage...."
if {[info exists DSERVER] && $DSERVER == "y"} {
  bool "Enable local Domain Server" "domain dns on"
  setlabel "" "domain ttl" 7200
}
label "Hostname to serve as a remote Domain Name Server" "domain addserver"
setlabel "" "domain maxwait" 10
setlabel "" "domain suffix" ampr.org.
setlabel "" "domain translate" off
setlabel "" "domain subnet" off
setlabel "" "domain verbose" off
setlabel "" "domain update" off
setlabel "" "domain cache size" 200
setlabel "" "domain cache clean" on
setlabel "" "domain cache wait" 3600
#
#
comment "Adding TCP global parameters...."
setlabel "" "tcp irtt" 1500
setlabel "" "tcp window" 1024
setlabel "" "tcp mss" 216
setlabel "" "tcp timer" linear
setlabel "" "tcp syndata" on
#
#
if {$ISUNIX == "y" && $SLIP == "y"} {
  comment "Attach the interface to the Unix kernel...."
  setlabel "" "attach asy ttypf - slip linux 1024 1024" 38400
  setlabel "" "asyconfig linux rxqueue" 30
  setlabel "" "asyconfig linux txqueue" 10
  setlabel "" "ifconfig linux description" "\"Slip Link to Unix\""
  label "IP Address of TNOS side of the link" "ifconfig linux ipaddress"
  label "Broadcast Address of the link" "ifconfig linux broadcast"
  label "Netmask for the link" "ifconfig linux netmask"
  setlabel "" "ifconfig linux tcp irtt" 500
}
#
#
#
if {$ENCAP == "y"} {
  comment "Commands for encap interface"
  setlabel "" "ifconfig encap mtu" 576
}
#
#
comment "Adding global IP commands....."
setlabel "" "ip ttl" 255
if {$ENCAP == "y"} {
  setlabel "" "ip encapnew" on
}
#
#
comment "Gentlemen, start your servers....."
bool "Start AX25 Server" "start ax25"
bool "Start SMTP Server" "start smtp"
bool "Start FTP Server" "start ftp"
bool "Start Finger Server" "start finger"
bool "Start Remote Command Server" "start remote"
if {$ALLSERV == "y"} {
  bool "Start Echo Server" "start echo"
  bool "Start Discard Server" "start discard"
  bool "Start Daytime Server" "start daytime"
  bool "Start Incoming Chat Server" "start ttylink"
  bool "Start Quote of the Day Server" "start quote"
  bool "Start Time Server" "start time"
}
if {$MAILBOX == "y"} {
  bool "Start BBS Server" "start telnet"
}
if {$CONVERS == "y"} {
  bool "Start Conference Server" "start convers 3600"
}
if {$RLOGINSERV  == "y"} {
  bool "Start RLogin Server" "start rlogin"
}
if {$TUTOR == "y"} {
  bool "Start Tutor Server" "start tutor"
  bool "Start Info Server" "start info"
  bool "Start News Server (not NNTP)" "start news"
}
if {$TRACESERVER == "y"} {
  bool "Start Trace Server" "start trace"
}
#

comment "Adding SMTP parameters....."
setlabel "" "smtp timer" 60
setlabel "" "smtp max" 4
setlabel "" "smtp trace" 0
setlabel "" "smtp usemx" on
setlabel "" "smtp batch" off
setlabel "" "smtp header" on
setlabel "" "smtp sendlzw" on
setlabel "" "smtp reclzw" on
setlabel "" "smtp bidcheck" on
setlabel "" "smtp notify" on
setlabel "" "smtp quiet" off
setlabel "" "smtp t4" 60
label "SMTP Gateway" "smtp gateway"
#
#
if {$MAILBOX == "y"}	{
  comment "BBS parameters....."
  setlabel "" "pbbs attend" on
  setlabel "" "pbbs enforce" on
  setlabel "" "pbbs motd" "\"Welcome to TNOS at ${HOSTNAME}!\""
  setlabel "" "pbbs jumpstart" on
  setlabel "" "pbbs tdisc" 900
  setlabel "" "pbbs tmsg" "\"Welcome! Please login with your call sign! Use any password!\n\""
  label "Enter an alias callsign for the BBS" "pbbs alias"
  label "Enter a password for remote sysop acceptance" "pbbs password"
  setlabel "" "pbbs log" on
  setlabel "" "pbbs nosubjbell" on
  bool "Do you wish to hold all locally generated mail for review" "pbbs holdall on"
  if {$ans == "y"} {
    setlabel "" "bulletin hold" on
  } else {
    bool "Do you wish to hold all locally generated BULLETINS for review" "bulletin hold on"
  }
  setlabel "" "errors" off
  bool "Will this be a full-service BBS" "pbbs fullservice on"
  if {$ans == "y"} {
    bool "Will you allow third-party traffic" "third on"
  }
  setlabel "" "motd" "\"Welcome to $HOSTNAME!\""
  setlabel "" "bulletin date" on
  setlabel "" "bulletin check" on
  setlabel "" "bulletin return" on

  if {$MAILFOR == "y"} {
    comment "Options for the Mailfor feature...."
    setlabel "" "pbbs mailfor exclude" $MYCALL
    setlabel "" "pbbs mailfor timer" 1200
    if {$HOLDMONITOR == "y"} {
      setlabel "" "pbbs mailfor hold mode" on
      if {[info exists SOUNDS] && $SOUNDS == "y"} {
        setlabel "" "pbbs mailfor hold sound" chat
      }
    }
    if {$ALERTMONITOR == "y"} {
      setlabel "" "pbbs mailfor alert mode" on
      setlabel "" "pbbs mailfor alert mbox" $MYCALL
      if {[info exists SOUNDS] && $SOUNDS == "y"} {
        setlabel "" "pbbs mailfor alert sound" chat
      }
    }
  }
}
#
#
if {$MBFWD == "y"} {
  comment "PBBS forwarding parameters......."
  commentmiddle "Forwarding leave 'off' till last thing......"
  label "Enter your haddress, minus your callsign" "forward haddress"
    setlabel "" "forward bid" on
    setlabel "" "forward lzw" off
    setlabel "" "forward mode" on
    if {$FBBFWD == "y"} {
      bool "Use FBB-style forwarding" "forward fbb-style on"
      if {$ans == "y" && $FBBCMP == "y"} {
        bool "Use FBB compressed forwarding" "forward fbb-compression on"
      }
    }
  setlabel "" "forward smtp" off
  setlabel "" "forward mycall" $MYCALL
  label "Local time is how many hours from UTC (i.e. +1, -4)" "forward utc"
}
#
#
comment "FTP parameters....."
setlabel "" "ftype" i
setlabel "" "ftptdisc" 300
label "Maximum number of incoming FTP sessions" "ftpmaxclients"
#
#
comment "AX25 global parameters (before attaching any AX25 interface)...."
setlabel "" "ax25 version" 2
setlabel "" "ax25 maxframe" 1
setlabel "" "ax25 pthresh" 128
setlabel "" "ax25 paclen" 256
setlabel "" "ax25 retries" 10
setlabel "" "ax25 irtt" 2000
setlabel "" "ax25 t3" 600000
setlabel "" "ax25 t4" 1800
setlabel "" "ax25 timertype" linear
setlabel "" "ax25 window" 2048
setlabel "" "ax25 blimit" 5
setlabel "" "ax25 smartroute" off
label "Callsign-SSID to use for outgoing connects" "ax25 user"
#
#
if {$ASY == "y"} {
  comment "AX25 interface setup ..."

  if {$ISUNIX == "n"} {
    set PORT "none"
    boollocal "Is you TNC connected to COM1" "y/n"
    if {$ans == "y"} {
      set PORT "0x3f8"
      set IRQ "4"
    } else {
      boollocal "Is you TNC connected to COM2" "y/n"
      if {$ans == "y"} {
        set PORT "0x2f8"
        set IRQ "3"
      }
    }
  } else {
    labellocal "What serial port is your TNC on" "ttyS0 - ttyS3" "ttyS0"
    set PORT "$ans"
    set IRQ "-"
  }
  if {$PORT == "none"} {
    puts "\nI was unable to setup your TNC port. You will have to manualy edit"
    puts "\nthe attach line into your autoexec.nos file.\n"
  } else {
    labellocal "what is the TNC's serial port baud rate" "1200 - 38400" "9600"
    set BAUD "$ans"
    setlabel "" "attach asy $PORT $IRQ ax25 tnc 1024 512" $BAUD
    setlabel "" "ifconfig tnc description" "\"$MYCALL tnc radio port\""
    label "IP address for your radio port" "ifconfig tnc ipaddress" "$IPADDR"
    label "Broadcast Address of the radio port" "ifconfig tnc broadcast"
    label "Netmask of the radio port" "ifconfig tnc netmask" "0xffffff00"
  }
}
#	
#
if {$CONVERS == "y"} {
  comment "Convers parameters"
  label "Enter an alias callsign for the Conference Bridge" "convers mycall"
  label "Enter a Conference hostname for your server" "convers hostname"
  label "Conference site to link to (if known)" "convers link"
  setlabel "" "convers hmax" 8192
  setlabel "" "convers umax" 1024
  setlabel "" "convers t4" 900
  setlabel "" "convers maxwait" 120
  setlabel "" "convers motd" "\"Check out the news (/news). Thanks! \[$MYCALL]\""
  setlabel "" "convers sysinfo" "\"New TNOS server $HOSTNAME"
}
#
comment "Security options...."
setlabel "" "security mbsecure" off
setlabel "" "security ax25perms" 0
setlabel "" "security amprperms" 0
setlabel "" "security nonamprperms" 0
#
#
if {$WPAGES == "y"} {
  comment "White Page commands...."
  setlabel "" "wpage client" on
  setlabel "" "wpage server" on
  setlabel "" "wpage age" 75
}
#
#
if {$XSERVER == "y"} {
  comment "TNOS/X commands....."
  label "Enter address of a trusted Xhost" "xwindows hosts"
  setlabel "" "start" x
}
#
#
comment "Assorted commands...."
setlabel "" "log" net.log
setlabel "" "history" 25
#
#
comment "Now some last minute details...."
if {$MBFWD == "y"} {
  setlabel "" "# Finally, NOW we can start the forwarding timer...." ""
  setlabel "" "forward timer" 300
  setlabel "" "forward" kick
}
setlabel "" "#" ""
setlabel "" "# And tell the world, that our work is complete!" ""
setlabel "" "echo *** Processing: autoexec.nos complete on {$(ver s)} \"   \" {$(time)}" ""
if {$STATS_USE == "y"} {
  setlabel "" "stats usage" general
}

